package main

import "fmt"

func main() {
	var flag bool
	flag = true
	fmt.Printf("flag = %d\n", flag) // flag = %!d(bool=true)

	fmt.Printf("flag = %t\n", flag)

	// cannot convert flag (type bool) to type int
	//fmt.Printf("flag = %d\n", int(flag))

	// 整形也不能转化为bool
	/*
		flag = bool(1) //cannot convert 1 (type untyped int) to type bool
		fmt.Println(flag)
	*/

	var ch byte
	ch = 'a'

	var t int
	t = int(ch)
	fmt.Println("t = ", t)

}
